/**
 * [description]
 * @author lu.hong 2016-09-05
 * @param  {[type]} $scope        [description]
 * @param  {[type]} i18nService   [description]
 * @param  {[type]} dialogService [description]
 * @param  {[type]} ngNotify      [description]
 * @param  {[type]} $compile)     {	}         [description]
 * @return {[type]}               [description]
 */
angular.module('app').controller('alertmodelController', ['$scope','i18nService','dialogService','ngNotify','$compile',function($scope,i18nService,dialogService,ngNotify,$compile) {
	$("[data-toggle='popover']").popover(); 

	$("#myAlert").bind('closed.bs.alert', function () { 
        alert("警告消息框被关闭。"); 
    });


    $scope.alertmodelclick = function(){
		var showmodeldata = {
			title:"",
			message:"",
			ngdata:$scope,
			url:'/templates/layout/setting.html',
			buttons:[{
		                label: 'primary',
		                cssClass: 'btn-primary',
		                action: function(){
	                		alert(111);
		                }
		            }, {
		                label: 'danger',
		                cssClass: 'btn-danger',
		                action: function(){
							alert(222);
		                }
		            }
		    ]
		};
		dialogService.showmodel(showmodeldata);
	};

	ngNotify.config({
	    theme: 'pure',
	    position: 'bottom',
	    duration: 3000,
	    type: 'info',
	    sticky: true,
	    button: true,
	    html: false
	});

	$scope.ngNotifyclick = function(){
		//default error info success warn grimace
		ngNotify.set('Your error message goes here!', 'default');
	};
}]);